/*

Dofile: table5_appendix.do 

Date: Dec. 10, 2016 
Aim: Baseline regressions with an alternatve measure of tariffs    

Input: base_for_reg.dta 
Output: table5_appendix.xls 
Reported in the online appendix: 
"Table A.5 – Baseline regressions Effective Marginal Tax Rate, all firms, alt. measure of tariff"

*/  

cd $datapath
use base_for_reg, clear

global name table5_appendix // name of the xls file where the results are sent 

global tax_var inter_linvemtr linvemtr // tax variable and its interaction 

areg luv type $tax_var inter_tarif_alt tarif_alt inter_lgdpc lgdpc inter_ldist ldist   , absorb(fpt) vce(cluster pays)
outreg2  type $tax_var inter_tarif_alt tarif_alt inter_lgdpc lgdpc inter_ldist ldist    using  "$resultpath/$name.xls" ,  label e(all) nocons bdec(2) symbol($^{***}$, $^{**}$, $^{*}$) adjr2    append 

global tax_var interdum_hines dum_hines
areg luv type $tax_var inter_tarif_alt tarif_alt inter_lgdpc lgdpc inter_ldist ldist  , absorb(fpt) vce(cluster pays)
outreg2  type $tax_var inter_tarif_alt tarif_alt inter_lgdpc lgdpc inter_ldist ldist    using  "$resultpath/$name.xls" ,  label e(all) nocons bdec(2) symbol($^{***}$, $^{**}$, $^{*}$) adjr2   append 

global tax_var interdum_hines dum_hines inter_linvemtr linvemtr 
areg luv type $tax_var inter_tarif_alt tarif_alt inter_lgdpc lgdpc inter_ldist ldist    , absorb(fpt) vce(cluster pays)
outreg2  type $tax_var inter_tarif_alt tarif_alt inter_lgdpc lgdpc inter_ldist ldist    using  "$resultpath/$name.xls" ,  label e(all) nocons bdec(2) symbol($^{***}$, $^{**}$, $^{*}$) adjr2   append 

areg luv type $tax_var inter_tarif_alt tarif_alt inter_lgdpc lgdpc inter_ldist ldist  if dum_hines==0, absorb(fpt) vce(cluster pays)
outreg2  type $tax_var inter_tarif_alt tarif_alt inter_lgdpc lgdpc inter_ldist ldist  using  "$resultpath/$name.xls" ,  label e(all) nocons bdec(2) symbol($^{***}$, $^{**}$, $^{*}$) adjr2    append 

global tax_var interdum_hines  inter_linvemtr // level variables not included - absorbed by the FE 
reghdfe luv type $tax_var inter_tarif_alt inter_lgdpc inter_ldist  , absorb(fpt c) vce(cluster pays)
outreg2  type $tax_var inter_tarif_alt tarif inter_lgdpc lgdpc inter_ldist ldist   using  "$resultpath/$name.xls" ,  label e(all) nocons bdec(2) symbol($^{***}$, $^{**}$, $^{*}$) adjr2    append
